﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StoreTrackingReport.aspx.cs" Inherits="H2.NET.Web.Pages.SMD.StoreTrackingReport" %>

<style>
     .flowpage1 {
         margin-top: 4px;
     }

    .report {
        text-align: center;
    }

    .report input {
        width: 30px;
        border: 0;
        border-bottom: 1px solid #a9a9a9;
        text-align: center;
    }
</style>
<script type="text/javascript">

    function dialogAjaxDone(json) {
        DWZ.ajaxDone(json);
    }

    function query3() {
        var year = $("#yearSearch", navTab.getCurrentPanel()).val();
        var month = $("#monthSearch", navTab.getCurrentPanel()).val();
        $("#storeRel").loadUrl("/Pages/SMD/StoreTrackingReport.aspx", { year: year,month:month
    }, null);

    }

    function exportSummary3() {
        var year = $("#yearSearch", navTab.getCurrentPanel()).val();
        var month = $("#monthSearch", navTab.getCurrentPanel()).val();
        $("#year").val(year);
        $("#month").val(month);
        $("#exportForm").submit();
    }

</script>
<div class="flowpage1" id="storeRel">
    <form id="formNew" runat="server" action="/Pages/SMD/StoreTrackingReport.aspx"
        method="post" onsubmit="return validateCallback(this,dialogAjaxDone);">
        <div class="flowContent">
            <table class="formTable">
                <tr>
                    <td>
                        年份：<input type="text" id="yearSearch" runat="server" />
                        月份：<input type="text" id="monthSearch" runat="server" />
                        <input type="button" value="查询" onclick="query3()" />
                        <input type="button" value="导出exel" onclick="exportSummary3()" />

                    </td>
                </tr>
            </table>
            <br />
            <div id="StoreTrackDiv" layoutH="50">
            <!--DdcnR -->
            <table class="formTable report">
                <tr>
                    <% for (var i = 0; i < DdcnR.Rows.Count; i++)
                       {
                           if (i != 2 && i != 3 && i != 4 && i != 5)
                           { %>
                    <td rowspan="2"><%: DdcnR.Rows[i]["name"] %></td>
                    <% }
                           else if (i == 2)
                           { %>
                    <td colspan="4">本月新增店数</td>
                    <% }
                       } %>
                </tr>
                <tr>
                    <td><%: DdcnR.Rows[2]["name"] %></td>
                    <td><%: DdcnR.Rows[3]["name"] %></td>
                    <td><%: DdcnR.Rows[4]["name"] %></td>
                    <td><%: DdcnR.Rows[5]["name"] %></td>
                </tr>
                <%  for (var i = 0; i < DdcnR1.Rows.Count; i++){%>
                    <tr>
                        <%for (var j = 0; j < DdcnR.Rows.Count; j++){ %>
                            
                                <td><%:DdcnR1.Rows[i][DdcnR.Rows[j]["code"].ToString()] %></td>
                            
                     <%}%>
                       </tr>
                    <%}%>
            </table>
                <br/>
            <!--DdcnC -->
            <table class="formTable report">
                <tr>
                    <% for (var i = 0; i < DdcnC.Rows.Count; i++)
                       {
                           if (i != 2 && i != 3 && i != 4 && i != 5)
                           { %>
                    <td rowspan="2"><%: DdcnC.Rows[i]["name"] %></td>
                    <% }
                           else if (i == 2)
                           { %>
                    <td colspan="4">本月新增店数</td>
                    <% }
                       } %>
                </tr>
                <tr>
                    <td><%: DdcnC.Rows[2]["name"] %></td>
                    <td><%: DdcnC.Rows[3]["name"] %></td>
                    <td><%: DdcnC.Rows[4]["name"] %></td>
                    <td><%: DdcnC.Rows[5]["name"] %></td>
                </tr>
                <%  for (var i = 0; i < DdcnC1.Rows.Count; i++)
                    {%>
                    <tr>
                        <%for (var j = 0; j < DdcnC.Rows.Count; j++)
                          { %>
                            
                                <td><%:DdcnC1.Rows[i][DdcnC.Rows[j]["code"].ToString()] %></td>
                            
                     <%}%>
                       </tr>
                    <%}%>
            </table>
                <br/>
            <!--DcssR -->
            <table class="formTable report">
                <tr>
                    <% for (var i = 0; i < DcssR.Rows.Count; i++)
                       {
                           if (i != 2 && i != 3 && i != 4 && i != 5)
                           { %>
                    <td rowspan="2"><%: DcssR.Rows[i]["name"] %></td>
                    <% }
                           else if (i == 2)
                           { %>
                    <td colspan="4">本月新增店数</td>
                    <% }
                       } %>
                </tr>
                <tr>
                    <td><%: DcssR.Rows[2]["name"] %></td>
                    <td><%: DcssR.Rows[3]["name"] %></td>
                    <td><%: DcssR.Rows[4]["name"] %></td>
                    <td><%: DcssR.Rows[5]["name"] %></td>
                </tr>
                <%  for (var i = 0; i < DcssR1.Rows.Count; i++)
                    {%>
                    <tr>
                        <%for (var j = 0; j < DcssR.Rows.Count; j++)
                          { %>
                            
                                <td><%:DcssR1.Rows[i][DcssR.Rows[j]["code"].ToString()] %></td>
                            
                     <%}%>
                       </tr>
                    <%}%>
            </table>
                <br/>
            <!--DcssC -->
            <table class="formTable report">
                <tr>
                    <% for (var i = 0; i < DcssC.Rows.Count; i++)
                       {
                           if (i != 2 && i != 3 && i != 4 && i != 5)
                           { %>
                    <td rowspan="2"><%: DcssC.Rows[i]["name"] %></td>
                    <% }
                           else if (i == 2)
                           { %>
                    <td colspan="4">本月新增店数</td>
                    <% }
                       } %>
                </tr>
                <tr>
                    <td><%: DcssC.Rows[2]["name"] %></td>
                    <td><%: DcssC.Rows[3]["name"] %></td>
                    <td><%: DcssC.Rows[4]["name"] %></td>
                    <td><%: DcssC.Rows[5]["name"] %></td>
                </tr>
                <%  for (var i = 0; i < DcssC1.Rows.Count; i++)
                    {%>
                    <tr>
                        <%for (var j = 0; j < DcssC.Rows.Count; j++)
                          { %>
                            
                                <td><%:DcssC1.Rows[i][DcssC.Rows[j]["code"].ToString()] %></td>
                            
                     <%}%>
                       </tr>
                    <%}%>
            </table>
                </div>
        </div>
    </form>
    
    <form id="exportForm" action="/Pages/SMD/StoreTrackingReport.aspx?action=export" method="post">
        <input type="hidden" name="year" id="year">
        <input type="hidden" name="month" id="month">
    </form>
</div>
